package com.itheima.mapper;

import com.alibaba.druid.support.spring.stat.annotation.Stat;
import com.itheima.pojo.NursingProject;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface NursingProjectMapper {
    //分页查询数据
    List<NursingProject> page(String name);

    //新增数据
    @Insert("insert into nursing_project(name,order_no,unit,price,image,nursing_requirement,status,create_by,update_by,remark,create_time,update_time) values (#{name},#{orderNo},#{unit},#{price},#{image},#{nursingRequirement},#{status},#{createBy},#{updateBy},#{remark},#{createTime},#{updateTime})")
    void add(NursingProject np);

    //删除数据

    void delete(List<Integer> ids);

    //修改数据第一步回显
    @Select("select * from nursing_project where id=#{id}")
    NursingProject getById(Integer id);

    //修改数据第二步删除操作
    void update(NursingProject np);
}
